package com.org.model;

/**
 * ProductSpecificationId entity. @author MyEclipse Persistence Tools
 */

public class ProductSpecificationId implements java.io.Serializable {

	// Fields

	private Product product;
	private Specification specification;

	// Constructors

	/** default constructor */
	public ProductSpecificationId() {
	}

	/** full constructor */
	public ProductSpecificationId(Product product, Specification specification) {
		this.product = product;
		this.specification = specification;
	}

	// Property accessors

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Specification getSpecification() {
		return this.specification;
	}

	public void setSpecification(Specification specification) {
		this.specification = specification;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ProductSpecificationId))
			return false;
		ProductSpecificationId castOther = (ProductSpecificationId) other;

		return ((this.getProduct() == castOther.getProduct()) || (this
				.getProduct() != null
				&& castOther.getProduct() != null && this.getProduct().equals(
				castOther.getProduct())))
				&& ((this.getSpecification() == castOther.getSpecification()) || (this
						.getSpecification() != null
						&& castOther.getSpecification() != null && this
						.getSpecification()
						.equals(castOther.getSpecification())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getProduct() == null ? 0 : this.getProduct().hashCode());
		result = 37
				* result
				+ (getSpecification() == null ? 0 : this.getSpecification()
						.hashCode());
		return result;
	}

}